//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#if _MSC_VER > 1000
#pragma once
#endif

#if !defined(__CKTFSFILESYSTEM_H__)
#define __CKTFSFILESYSTEM_H__

#define _NO_CKTFSFILESYSTEM_CLASSOBJECT_
#include "_CKtfsFileSystem.h"
#ifndef _win32
#include "stub.h"
#endif

class CKtfsFileSystem : public _CKtfsFileSystem
{
public:
    CARAPI Sync();

    CARAPI GetRoot(
        /* [out] */ IBasicDirectory * * piRoot);

    CARAPI Lookup(
        /* [in] */ WString wstrPath,
        /* [out] */ IBasicFile * * piBasicFile);

    CARAPI GetStat(
        /* [out] */ FileSystemStat * pFileSystemStat);

    CARAPI Mount(
        /* [in] */ WString type,
        /* [in] */ WString dir,
        /* [in] */ WString vDevName,
        /* [in] */ UInt32 flags);

    CARAPI Unmount(
        /* [in] */ WString dir,
        /* [in] */ UInt32 flags);

    CARAPI BindDriver(
        /* [in] */ WString wstrDevName);

    CARAPI UnbindDriver();

    CKtfsFileSystem();
    ~CKtfsFileSystem();
    IStub *GetStub();
    void SetStub(IStub *pStub);

private:
    IBasicDirectory *m_pRootIBasicDirector;
    class CFatFile *m_pRootCFatFile;
    class fat_filesystem *m_pFileSystem;
    IStub *m_pStub;
    IThread* m_pSyncThread;
};

#endif //!(__CBASICFILESYSTEM_H__)
